
/**
 * 验证邮箱
 * @param {string} email
 * @returns {Boolean}
 */
export function validEmail(email) {
  const reg = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/
  return reg.test(email)
}

/**
 * 验证密码
 * @param {string} email
 * @returns {Boolean}
 */
export function validPassword(email) {
  const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]/
  return reg.test(email)
}

/**
 * 验证手机号码
 * @param {number} phone 
 * @returns {Boolean}
 */
export function checkPhone(phone) {
  if (!(/^1[3456789]\d{9}$/.test(phone))) {
    console.warn("手机号码不合法，请重新输入");
    return false;
  } else {
    return true;
  }
}